#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    m_newspaper = new Newspaper(QStringLiteral("newspaper"));
    m_reader = new Reader();

    QObject::connect(m_newspaper, &Newspaper::newPaper, m_reader, &Reader::get_newspaper);

    QObject::connect(ui->newspaperPushButton, &QPushButton::clicked, m_newspaper, &Newspaper::send);
    QObject::connect(ui->lamdaPushButton, &QPushButton::clicked, [](bool){ qDebug("click lamda button");});
    QObject::connect(ui->quitPushButton, &QPushButton::clicked, &QApplication::quit);

}

MainWindow::~MainWindow()
{
    delete ui;
}
